package user;

public class RegisterManager {
	private static DBConnector db = DBConnector.getDBConnector();
	
	public RegisterManager() {
	}
	
	public static boolean register(String type, String... value) {
		if (type.equals("cus")) {
			String sql = "insert into customer values (null,\'" 
				  + value[1] + "\',\'" 
				  + value[0] + "\',\'" 
				  + value[2] + "\',\'" 
				  + value[3] + "\',\'" 
				  + value[4] + "\',\'" 
				  + value[5] + "\',null);";
			db.update(sql);
			return true;
		} else if (type.equals("rest")){
			String sql = "insert into restaurant values (null,\'" 
				  + value[1] + "\',\'" 
				  + value[0] + "\',\'" 
				  + value[2] + "\',\'" 
				  + value[3] + "\',\'" 
				  + value[4] + "\',00.00,00.00, null, null, 'default_restaurant.JPG', '8:00 a.m.', '22:00 p.m.', null, '" 
				  + value[5] + "');";
			//System.out.println(sql);
			db.update(sql);
			return true;			
		} else 
			return false;
		
	}
	
}
